package com.example.blog.entity;

import lombok.Data;

import java.util.Date;

@Data

public class User {


    private Long id;


    private String username;


    private String password;


    private String email;


    private String avatar;


    private Date createTime;


    private Date updateTime;

    // 可以添加一个方法来初始化默认值
    public void init() {
        if (createTime == null) {
            createTime = new Date();
        }
        updateTime = new Date();
    }

}